﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using dbcntn;

namespace Campus.Main.Basic.InsertValues
{
    public partial class Bolum : Default
    {
        public Bolum(List<string> aList)
        {
            InitializeComponent();
            aToDb=new ConnectionToDb(Helper.ConnectionString);
            aToDb.AddItem(comboBox1,"fakulty");
            id = aList[0];
            comboBox1.SelectedValue = aList[1];
            textBox1.Text = aList[2];
        }


        protected override void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length>0)
            {
                string fakulty_id = Convert.ToString(comboBox1.SelectedValue), desc = textBox1.Text;
                aToDb.UpdateTable("bolum","fakulty_id","description",fakulty_id,desc,id);
                Close();
            }
            else
            {
                MessageBox.Show("Талааларды толтургула!!!");

            }
        }
    }
}
